//存放所有用户相关的接口函数
import axios from 'axios'
//设置请求基本服务器路径
axios.defaults.baseURL='http://127.0.0.1:5000'

//用户登录
//把需要axios返回出
export let login = params => axios.post("/users/checkLogin", params)

// 添加用户
export let adduser = params => axios.post("/users/add", params)

// 账户列表
export let listuser = params => axios.get("/users/list", {params})

// 删除单个数据
export let deluser = params => axios.get("/users/del", {params})

// 批量删除
export let alluser = params => axios.get('/users/batchdel', { params })

// 编辑用户信息
export let edituser = params => axios.post('users/edit', params)

// 检查密码
export let pwdchecko = params => axios.get('/users/checkoldpwd', { params })

// 修改密码
export let pwdedit = params => axios.post('/users/editpwd', params)

// 注意axios的get和post发送参数的方式不同
// axios.get('接口', {params: {参数1: val1, 参数2: val2}})
// axios.post('接口', {参数1: va1, 参数2, val2})去,方便在对应组件中.then接响应
